import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;


import java.util.Objects;

@Setter
@Getter
@EqualsAndHashCode
public class Cat {
    private String name;
    private int age;
    private int weight;

    @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", weight=" + weight +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        Cat cat = (Cat) o;
        return age == cat.age && weight == cat.weight && Objects.equals(name, cat.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, weight);
    }
}


